import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysMsgLog = (params) => {
  params.head.transCode = 'querySysMsgLog';
  return request({
    url: '/platform/sysMsgLog/querySysMsgLog',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysMsgLogListPage = (params) => {
  params.head.transCode = 'querySysMsgLogListPage';
  return request({
    url: '/platform/sysMsgLog/querySysMsgLogListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysMsgLog = (params) => {
  params.head.transCode = 'saveSysMsgLog';
  return request({
    url: '/platform/sysMsgLog/saveSysMsgLog',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysMsgLogList = (params) => {
  params.head.transCode = 'saveSysMsgLogList';
  return request({
    url: '/platform/sysMsgLog/saveSysMsgLogList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysMsgLog = (params) => {
  params.head.transCode = 'saveOrUpdateSysMsgLog';
  return request({
    url: '/platform/sysMsgLog/saveOrUpdateSysMsgLog',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysMsgLogList = (params) => {
  params.head.transCode = 'saveOrUpdateSysMsgLogList';
  return request({
    url: '/platform/sysMsgLog/saveOrUpdateSysMsgLogList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysMsgLog = (params) => {
  params.head.transCode = 'updateSysMsgLog';
  return request({
    url: '/platform/sysMsgLog/updateSysMsgLog',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysMsgLog = (params) => {
  params.head.transCode = 'deleteSysMsgLog';
  return request({
    url: '/platform/sysMsgLog/deleteSysMsgLog',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysMsgLogList = (params) => {
  params.head.transCode = 'deleteSysMsgLogList';
  return request({
    url: '/platform/sysMsgLog/deleteSysMsgLogList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysMsgLogExcel = (params) => {
  downloadExcel({
    url: '/platform/sysMsgLog/excelDownload/exportSysMsgLogExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
